#include <cstdio>
#include <iostream>
using namespace std;

int n, need, have, tmp;

int main() { 
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++) { 
        cin >> tmp;
        if (tmp == 25) have += 1;
        else need += tmp / 25 - 1;
    }
    if (have >= need) cout << "YES" << endl;
    else cout << "NO" << endl;
}
